使用Scoop安装、管理常用的编程字体

您所在的位置:网站首页 source code pro中文 使用Scoop安装、管理常用的编程字体

使用Scoop安装、管理常用的编程字体

2023-10-08 07:19| 来源: 网络整理| 查看: 265

scoop-nerd-fonts是一个包含了大多数热门编程字体的Scoop Bucket,除了包括Nerd Fonts的所有字体,还包括了一些热门的编程字体,如更纱黑体、JetBrains-Mono、Source Code Pro等,而且该仓库已经加入了Scoop Known Buckets,使用以下命令可以直接添加:

scoop bucket add nerd-fonts

Windows上看着舒服且支持中文的编程字体确实不多,之前一直使用YaHei Consolas Hybrid,去年开始使用更纱黑体,直到更纱黑体上架Microsoft Store后,终于省了不少事情。而从Microsoft Store安装的字体被放在了C:\Program Files\WindowsApps*目录下(因为有收费的字体,此举应该是出于DRM的考虑?),目前Android Studio、PyCharm等未适配的程序无法找到对应的字体。考虑到还有一些Windows 10 LSTC、Windows Server之类的机器,用scoop-nerd-fonts是最省事的。

而scoop-nerd-fonts安装字体和手动的一样,复制文件并添加相关的注册表项,因此没有兼容性的问题:

"installer": { "script": [ "Invoke-ExternalCommand 7z -ArgumentList('e', \"$dir\\dl.7z_\" ,\"-o$dir\", '*-sc-*.ttf') | Out-Null", "Remove-Item \"$dir\\dl.7z_\"", "Get-ChildItem $dir -filter 'sarasa*.ttf' | ForEach-Object {", " New-ItemProperty -Path 'HKLM:\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Fonts' -Name $_.Name.Replace($_.Extension, ' (TrueType)') -Value $_.Name -Force | Out-Null", " Copy-Item $_.FullName -destination \"$env:windir\\Fonts\"", "}" ] }, "uninstaller": { "script": [ "Get-ChildItem $dir -filter 'sarasa*.ttf' | ForEach-Object {", " Remove-ItemProperty -Path 'HKLM:\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Fonts' -Name $_.Name.Replace($_.Extension, ' (TrueType)') -Force -ErrorAction SilentlyContinue", " Remove-Item \"$env:windir\\Fonts\\$($_.Name)\" -Force -ErrorAction SilentlyContinue", "}", "Write-Host \"The 'Sarasa-Gothic' Font family has been uninstalled and will not be present after restarting your computer.\" -Foreground Magenta" ] }

在该仓库中,*-NF.json结尾的字体均为Nerd-Fonts仓库中的字体,即Patch过的字体,其他为原始的字体。安装、卸载需要管理员权限,同时需要提前安装7z等解压工具。然后安装字体:

scoop install SarasaGothic-SC # 安装更纱黑体(简体中文) scoop install Wenquanyi-Microhei # 安装文泉驿微米黑 scoop install Wenquanyi-Zenhei # 安装文泉驿正黑



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3